<?php
	include("includes/secure.php");
	include("includes/config.php");
	include("includes/class/parameter.class.php");
	
	$parameter = new Parameter(); 	
	
	$msg_info = $msg_alert = $msg_error = false;
	$_SESSION['msg_cool'] = '';
	$show_msg = 0;
			
	if(isset($_POST['addParameter']) && $_POST['addParameter'] == 1){
		$action = $_POST["action"];
		$data->param_value_admission = trim(mysql_real_escape_string($_POST['param_value_admission']));
		$data->param_salary   =  trim(mysql_real_escape_string($_POST['param_salary']));
		$data->param_aporte   =  trim(mysql_real_escape_string($_POST['param_aporte']));
		$data->param_periodo   =  trim(mysql_real_escape_string($_POST['param_periodo']));
		$data->param_transporte   =  trim(mysql_real_escape_string($_POST['param_transporte']));
		$data->param_contribuciones   =  trim(mysql_real_escape_string($_POST['param_contribuciones']));
		$data->param_description   =  trim(mysql_real_escape_string($_POST['param_description']));
	
		if ($data=$afp->addAfp($data) ){
			$msg_info = true;
			$_SESSION["msg_cool"] .= 'Los parametros fueron adicionados satisfactoriamente!!.<br />';
			echo "<script> window.location.href='listParameter.php?show_msg=3'</script>";
				
		}
		else{
			$msg_info = true;
			$_SESSION["msg_cool"] .= 'No pudieron ser adicionados los parametros!.<br />';
			echo "<script> window.location.href='listParameter.php?show_msg=1'</script>";
		}
	}
	
	if ( $msg_error )
		$show_msg = 1;
	elseif ( $msg_alert )
		$show_msg = 2;
	elseif ( $msg_info )
		$show_msg = 3;
?>